Repository navigation
fix(OPENFRAM-002-20): CU-17tkuw60605 2 review findings in JsonKafkaListener.java - #2311
flamingo[bot] wants to merge 1 commit into
Conversation
| "${openframe.oss-tenant.kafka.topics.inbound.fleet-mdm-query-result-events.name}", | ||
| "${openframe.oss-tenant.kafka.topics.inbound.fleet-mdm-policy-membership-events.name}" | ||
| }, | ||
| groupId = "${spring.oss-tenant.kafka.consumer.group-id}" | ||
| groupId = "${spring.oss-tenant.kafka.consumer.group-id}", | ||
| containerFactory = "ossTenantKafkaListenerContainerFactory" | ||
| ) | ||
| public void listenIntegratedToolsEvents(@Payload CommonDebeziumMessage debeziumMessage, @Header(KafkaHeader.MESSAGE_TYPE_HEADER) MessageType messageType) { | ||
| messageProcessor.process(debeziumMessage, messageType); |
There was a problem hiding this comment.
🦩 🔴 JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory
Added containerFactory = "ossTenantKafkaListenerContainerFactory" to the @KafkaListener annotation on listenIntegratedToolsEvents in JsonKafkaListener, matching the required tenant-scoped container factory used by sibling listeners.
🤖 Prompt for AI agents
In openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java around line 29, review and complete this code-review fix: JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory.
What the draft fix changed: Added `containerFactory = "ossTenantKafkaListenerContainerFactory"` to the `@KafkaListener` annotation on `listenIntegratedToolsEvents` in `JsonKafkaListener`, matching the required tenant-scoped container factory used by sibling listeners.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer
| @@ -17,7 +17,7 @@ | |||
| * resolution). Shared SaaS deployments use {@code SharedMeshCentralKafkaListener}. | |||
| */ | |||
| @Service | |||
There was a problem hiding this comment.
🦩 🔴 JsonKafkaListener not gated with @ConditionalOnProperty on topic name, uses cluster.mode instead
Replaced the class-level @ConditionalOnProperty(name = "openframe.cluster.mode", havingValue = "tenant", matchIfMissing = true) with @ConditionalOnProperty(name = "openframe.oss-tenant.kafka.topics.inbound.meshcentral-events.name") to gate on a topic-name property per the rule. This only guards against the first of the four inbound topic properties being unset; the other three (fleet-mdm-events, fleet-mdm-query-result-events, fleet-mdm-policy-membership-events) are not covered because @ConditionalOnProperty's name attribute only reliably supports a single property key per annotation instance without additional array/havingValue semantics matching all four independently. A complete fix would require either verifying all four properties are always set together (documenting that assumption), or restructuring into separate listener methods/classes each individually gated by its own topic property — this could not be done without altering the class's public shape beyond a minimal fix, so it is flagged as low confidence and risk.
🤖 Prompt for AI agents
In openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java around line 19, review and complete this code-review fix: JsonKafkaListener not gated with @ConditionalOnProperty on topic name, uses cluster.mode instead.
What the draft fix changed: Replaced the class-level `@ConditionalOnProperty(name = "openframe.cluster.mode", havingValue = "tenant", matchIfMissing = true)` with `@ConditionalOnProperty(name = "openframe.oss-tenant.kafka.topics.inbound.meshcentral-events.name")` to gate on a topic-name property per the rule. This only guards against the first of the four inbound topic properties being unset; the other three (`fleet-mdm-events`, `fleet-mdm-query-result-events`, `fleet-mdm-policy-membership-events`) are not covered because `@ConditionalOnProperty`'s `name` attribute only reliably supports a single property key per annotation instance without additional array/`havingValue` semantics matching all four independently. A complete fix would require either verifying all four properties are always set together (documenting that assumption), or restructuring into separate listener methods/classes each individually gated by its own topic property — this could not be done without altering the class's public shape beyond a minimal fix, so it is flagged as low confidence and risk.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.
fix confidence: 🔴 40 low — review closely — react 👍/👎 to teach the reviewer
Closes 2 review findings in
openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java.Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java:29openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java:19What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
2f5354be-1063-40a0-9e57-0c222e1d58feMerging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.
ClickUp task: CU-17tkuw60605 Duplicate key and listener cleanup (OPENFRAM-002-20) (1 PRs)